#include "SquarePulse.h"

#include <cmath>
#include <iostream>

SquarePulse::SquarePulse()
{

}

SquarePulse::~SquarePulse()
{

}
void SquarePulse::Current(NewParameters params)
{
  length=params.getCurrentPulse()["length"];
  level=params.getCurrent()["value"];
}

void SquarePulse::Field(NewParameters params)
{
  length=params.getFieldPulse()["length"];
  level=params.getField()["value"];
  angle=params.getField()["theta"];
  angle2=params.getField()["phi"];
}

double SquarePulse::getLevel(double timestamp)
{
  if(timestamp<length)
    return level;
  else return 0;
}
